﻿<%@ Page Language="C#" MasterPageFile="../../MasterPage.Master" AutoEventWireup="true" CodeBehind="ICM_Inventory_Stock_Taking.aspx.cs" Inherits="KPIS.GERP.GIMS.APP.APP_UI.Form.ICM_Inventory_Stock_Taking" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="server">
<script type="text/javascript">
            function openStatusEdit(icm_stock_taking_code)
            {
                   radopen("../Edit_Form/ICM_Inventory_Stock_Taking.aspx?icm_stock_taking_code="+icm_stock_taking_code,"WindowEdit" );
            }
            function openStautsAdd()
            {
                   radopen("../Add_Form/ICM_Inventory_Stock_Taking.aspx"+ "?icm_stock_taking_code="+"" ,"WindowDetail");
            }
            function closeRadWindow(sender, args) {
                   $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest('Receive');
            }
</script>  
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
                    <AjaxSettings>
                        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="grdCheckStock" LoadingPanelID="RadAjaxLoadingPanel1" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                        <telerik:AjaxSetting AjaxControlID="grdCheckStock">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="grdCheckStock" LoadingPanelID="RadAjaxLoadingPanel1" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                        <telerik:AjaxSetting AjaxControlID="btnInsert">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="btnInsert" LoadingPanelID="RadAjaxLoadingPanel1" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                    </AjaxSettings>    
    </telerik:RadAjaxManager>
          <div class="moduleContent1000">
           <div class="moduleDivBottom1000">
                 <asp:Panel ID="Panel2" runat="server" CssClass="contentPaneDiv" Height="30px" ScrollBars="Auto" >
                            <table cellpadding="0" cellspacing="0">
                                <tr class="command-list">
                                    <td>
                                        <asp:LinkButton ID="btnInsert" runat="server" CausesValidation="false" CssClass="LinkButton" OnClick="btnInsert_OnClick">
                                        <img alt="" src="../Image/Grid/AddRecord.gif" style="border:0px;vertical-align:middle;" />&#160;&#160;เพิ่มข้อมูลใหม่ </asp:LinkButton>
                                    </td>
                                </tr>
                            </table>
                  </asp:Panel>
            </div>
</div>
<div class="moduleContent1000">
              <div class="moduleDivBottom1000">
                 <asp:Panel ID="Panel1" runat="server" CssClass="contentPaneDiv" Height="400px" ScrollBars="Auto" align = "center" >    
                           <div class="header-grid" align="left">
                                <asp:Label ID="Label4" runat="server" Text="รายการตรวจนับพัสดุ"></asp:Label>
                           </div> 
                           <table>
                                  <tr>
                                        <td>
                                            <telerik:RadGrid ID="grdCheckStock" runat="server" AutoGenerateColumns="false"
                                                                AllowMultiRowEdit="false" AllowMultiRowSelection="true" ShowStatusBar="true"
                                                                Width="900px" Height="288px" AllowPaging="true" AllowFilteringByColumn="true"
                                                                GroupingSettings-GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;"
                                                                GroupingSettings-GroupContinuedFormatString=""
                                                                GroupingSettings-GroupContinuesFormatString=""
                                                                GroupingSettings-GroupSplitFormat="" PageSize ="7" 
                                                                OnNeedDataSource="grdCheckStock_NeedDataSource" 
                                                                OnItemCommand="grdCheckStock_ItemCommand" align ="left">
                                                                <MasterTableView AllowMultiColumnSorting="True" CellSpacing="-1" GroupLoadMode="Client"
                                                                ShowGroupFooter="true" 
                                                                DataKeyNames="icm_stock_taking_code" NoMasterRecordsText="< ไม่มีข้อมูล >" GroupsDefaultExpanded="true">
                                            <RowIndicatorColumn>
                                                <HeaderStyle Width="20px" />
                                            </RowIndicatorColumn>
                                            <ExpandCollapseColumn>
                                                <HeaderStyle Width="20px" />
                                            </ExpandCollapseColumn>
                                            <Columns>   
                                                <telerik:GridTemplateColumn DataField="icm_stock_taking_code" HeaderText="เลขที่รายการตรวจนับ" ShowFilterIcon="false" HeaderStyle-Font-Bold="true" AutoPostBackOnFilter="true"
                                                        HeaderStyle-Width="120px" HeaderStyle-HorizontalAlign="Center" FilterControlWidth="100%" UniqueName="icm_stock_taking_code" AllowFiltering = "true">
                                                        <ItemTemplate >                                                                                                                           
                                                                <asp:LinkButton ID="targetControl" runat="server" Text='<%# Eval("icm_stock_taking_code") %>' 
                                                                OnClientClick='<%# string.Format("return openStatusEdit(\"{0}\");", Eval("icm_stock_taking_code")) %>'  > 
                                                                </asp:LinkButton><%--OnClientClick='<%# string.Format("return openReceiveEdit(\"{0}\",\"{1}\");", Eval("trans_mas_seq"),"Edit") %>'--%>
                                                        </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                                <telerik:GridBoundColumn DataField="stock_taking_start_date" DataFormatString="{0:d}"
                                                    HeaderText="วันที่เริ่มตรวจนับ" UniqueName="stock_taking_start_date" AllowFiltering = "true"
                                                    FilterControlWidth="100%" AutoPostBackOnFilter="true"
                                                    CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderStyle-Width="100px"
                                                    HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="stock_taking_end_date" DataFormatString="{0:d}"
                                                    HeaderText="วันที่สิ้นสุดตรวจนับ" UniqueName="stock_taking_end_date" AllowFiltering = "true"
                                                    FilterControlWidth="100%" AutoPostBackOnFilter="true"
                                                    CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderStyle-Width="100px"
                                                    HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridTemplateColumn DataField="stock_taking_desc" HeaderText="รายการตรวจนับ" ShowFilterIcon="false" HeaderStyle-Font-Bold="true"
                                                        HeaderStyle-HorizontalAlign="Center" FilterControlWidth="100%" UniqueName="stock_taking_desc" AllowFiltering = "true" AutoPostBackOnFilter="true">
                                                        <ItemTemplate >                                                                                                                           
                                                                <asp:LinkButton ID="stock_taking_desc" runat="server" Text='<%# Eval("stock_taking_desc") %>' 
                                                                OnClientClick='<%# string.Format("return openStatusEdit(\"{0}\");", Eval("icm_stock_taking_code")) %>'  > 
                                                                </asp:LinkButton>
                                                        </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                                <telerik:GridBoundColumn DataField="location_name" 
                                                    HeaderText="สถานที่ตรวจนับ" UniqueName="location_name"
                                                    FilterControlWidth="100%" AutoPostBackOnFilter="true" AllowFiltering = "true"
                                                    CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderStyle-Width="120px"
                                                    HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="approved_name" 
                                                    HeaderText="ผู้ตรวจสอบการตรวจนับ" UniqueName="approved_name"
                                                    FilterControlWidth="100%" AutoPostBackOnFilter="true" AllowFiltering = "true"
                                                    CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderStyle-Width="120px"
                                                    HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridTemplateColumn AllowFiltering="false" UniqueName="Delete" HeaderText="ลบ" HeaderStyle-Width="35px" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center"> 
                                                    <FilterTemplate></FilterTemplate>
                                                    <ItemTemplate>
                                                             &nbsp;&nbsp;&nbsp;
                                                             <asp:ImageButton ID="cmdDelete" runat="server" CommandName="DataDelete"
                                                                ImageUrl="~/App_UI/Image/Grid/Delete.gif" OnClientClick="javascript:return confirm('ยืนยันการลบข้อมูลที่เลือก')"
                                                                ToolTip="ลบรายการ" width="17" /> 
                                                    </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                            </Columns>
                                            <PagerStyle Mode="NumericPages" AlwaysVisible="true" 
                                                                            FirstPageToolTip="กลับหน้าแรก" LastPageToolTip="ไปหน้าสุดท้าย" 
                                                                            NextPagesToolTip="หน้าถัดไป" NextPageToolTip="หน้าถัดไป" 
                                                                            PrevPagesToolTip="ย้อนกลับ" PrevPageToolTip="ย้อนกลับ" />
                                            </MasterTableView>
                                            <GroupingSettings GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;" 
                                                                GroupContinuedFormatString="" GroupContinuesFormatString="" 
                                                                GroupSplitFormat="" />
                                            <ClientSettings EnableRowHoverStyle="True">
                                                <Selecting AllowRowSelect="true" />
                                                <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                                            </ClientSettings>
                                      </telerik:RadGrid>
                                        </td>
                                  </tr>
                           </table>
                 </asp:Panel>
              </div>
</div>                           
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" >
    <Windows>
        <telerik:RadWindow ID="WindowDetail" runat="server" Width="1016px" Height="425px"
            showcontentduringload="false"  VisibleStatusbar="false"
            Modal="true" Skin = "Vista" behaviors="Close"
            title="รายการตรวจนับพัสดุ" 
            OnClientClose="closeRadWindow" >
        </telerik:RadWindow>
    </Windows>
       <Windows>
        <telerik:RadWindow ID="WindowEdit" runat="server" Width="1016px" Height="535px"
            showcontentduringload="false"  VisibleStatusbar="false"
            Modal="true" Skin = "Vista" behaviors="Close"
            title="รายการตรวจนับพัสดุ" 
            OnClientClose="closeRadWindow" >
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager> 

</asp:Content>